﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%--   
<button id="bom" class="btn" style="margin-left:100px; width:120px;">Report</button>
<button id="mat" class="btn" style="margin-left:100px; width:120px;">MatToMat</button>--%>
<h1>Report</h1>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">

</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="TableContent" runat="server">
<style type="text/css">
.block {
	border:1px solid #afafaf;
	border-top-width:3px;
	padding:0 10px;
	background-color:White;
}
.inactivecat, .activecat   {
  padding:10px 5px 8px;
  border-bottom:1px dashed #ccc;
  text-align:left;

}
.inactivecat a
{
  color:#5793DB !important; 
  font-weight:bolder;
}
.activecat a
{
  color:#ff0000 !important; 
  font-weight:bolder;
}
a {text-decoration:none; outline:none; }
a:hover {color:#ff0000;  text-decoration: none;}
.btn
{
margin-top:10px;
width:120px;
height:25px;
margin-right:5px;
}
.hide
{
    display:none;
}
</style>
    <div class="block" style="width:180px;	float:left;">
        <table cellspacing="0" cellpadding="0">
            <tbody>
               
                <tr>
                    <td class="activecat">
                        <a href="#" id="a1">&nbsp;1.&nbsp;&nbsp;Head &amp; Tail&nbsp;</a>
                    </td>
                </tr>
    
           
                <tr>
                    <td class="inactivecat">
                        <a href="#" id="a3">&nbsp;2.&nbsp;&nbsp;Mat To Mat&nbsp;</a>
                    </td>
                </tr>
     

            </tbody>
        </table>
        <br>
    </div>
      <div class="block" style="width:800px; height:180px; float:left;">
      <br />
        <table>
        <tr ><td colspan="2" style="font-size:large; line-height:40px;" id="nmRpt" ></td></tr>
        <tr id="biasno" ><td class="head cell" style="width:150px; height:30px;">Biasno</td><td class="cell">
            <input type="text" id="txtbiasno"  maxlength="2" /></td></tr>
        <tr id="df" ><td class="head cell" style="width:150px; height:30px;">Date From</td><td class="cell"><input type="text" id="dFrom"/></td></tr>
        <tr id="dt"><td class ="head cell" style="width:150px; height:30px;">Date To</td><td class="cell"><input type="text"  id="dTo"/><button  id="search"></button></td></tr>
        
        </table>
      </div>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="ScriptsSection" runat="server">

    <% if (false)
      { %>
   <script src="../../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
   <% }; %>

   <script type="text/javascript">
       $(function () {
           $('#dFrom').dateEntry({ useMouseWheel: false, dateFormat: 'dmy/' })
           $('#dTo').dateEntry({ useMouseWheel: false, dateFormat: 'dmy/' })
           $("#nmRpt").text($(".activecat").text());

           $("#search").button({
               icons: { primary: 'ui-icon-circle-zoomout' }, text: false
           }).click(function () {
               var report = ($(".activecat").find("a").attr("id"));
               if ($("#dFrom").val() == "") {
                   alert("ระบุวันที่ DateFrom");
                   $("#dFrom").focus();
                   return;
               }
               var url
               switch (report) {
                   case "a1":
                       $.download('<%=Url.Action("Table_Head_Tail") %>', "dFrom=" + $("#dFrom").val() + "&dTo=" + $("#dTo").val() + "&biasno=" + $("#txtbiasno").val())
                       break;
                   case "a3":
                       $.download('<%=Url.Action("Table_SEL_MAT") %>', "dFrom=" + $("#dFrom").val() + "&dTo=" + $("#dTo").val() + "&biasno=" + $("#txtbiasno").val())
                       break;                  
               }
          

           }); //click
           $(".inactivecat").live("click", function () {
               var link = $(this);
               $(".activecat").removeClass("activecat").addClass("inactivecat");
               link.removeClass("inactivecat").addClass("activecat");
               $("#nmRpt").text(link.text());             

           });

          

       });
      </script>
</asp:Content>
